package com.taotaojs.myboot.service;

import com.taotaojs.myboot.bean.DemoBean;
import com.taotaojs.myboot.mapper.DemoMapper;
import com.taotaojs.mybootsuper.service.MyComService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: TaoTaojs
 * @Date: 2019/3/13 23:35
 * @Description:
 * 测试类Service
 * @关联类:
 * @参考链接：
 */
@Service
public class DemoService extends MyComService<DemoBean> {

    @Autowired
    private DemoMapper mapper;

    public List<DemoBean> getList(){
        return mapper.selectAll();
    }

    public List<DemoBean> getListById(Integer id){
        DemoBean demoBean = new DemoBean();
        demoBean.setId(id);
        return mapper.select(demoBean);
    }

    /**
     * 与Mapper文件的兼容测试方法
     * @return
     */
    public Integer getStatistics(){
        return mapper.getStatistics();
    }

}
